<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="navbar.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'new_idea.jsp' starting page</title>
	<link rel="stylesheet" type="text/css" href="styles/css/bootstrap.min.css" />
	<link rel="stylesheet" href="styles/ueditor/themes/default/ueditor.css"> 
	
  </head>
  
  <body class="body">
    <div class="container" style="margin-top:60px;width:960px;margin-left:auto;margin-right:auto;">
	  <div class="row">
	
	
		<!-- 导入左侧部分 -->
		<jsp:include page="side.jsp">
			<jsp:param value="idea" name="tag"/>
		</jsp:include>
		
		
		<div class="span9">
			<form action="idea.jspx?m=new_idea" method="post" id="myform">
        <fieldset>
          <legend>发表新想法</legend>
          <div class="control-group">

            <label class="control-label" for="input01">标题</label>
            <div class="controls">
              <div id="ss"><input type="text" name="ideaname" class="span9" id="ideaName" x-webkit-speech="undefined" style="height:30px"></div><br />
			  <span id="span1" style="color:red;"></span>
            </div>
          </div>
		  <div class="control-group">
            <label class="control-label" for="input01">内容</label>
            <div class="controls">
				 <textarea name="desc" id="" class="span9" rows="15"></textarea>
              
              
            </div>
          </div>

          <div class="form-actions">
            <button type="button" id="btnSubmit" class="btn btn-primary">保存</button>
         	<a href="idea.jspx" class="btn">返回</a>
          </div>

        </fieldset>
      </form>          
          	
		</div>
		<div class="span3">
			
		</div>
	  </div>
	</div>

	<script type="text/javascript" src="styles/jquery/jquery.js"></script>
	
	<script type="text/javascript">
		
	   
	   
	    $(document).ready(function(){
			$("#btnSubmit").click(function(){
				var ideaName = $("#ideaName").val();
				if(ideaName.trim().length == 0){
					$("#span1").html("标题不能为空！");
					$("#ideaName").focus();
					return;
				} else if(ideaName.length > 10){
					$("#span1").html("标题长度不能大于10");
					$("#ideaName").focus();
					return;										
				}
				
				
				
			/* 	
				var desc = $("#desc").val();
				if(desc.trim().length == 0){
					$("#span2").html("内容不能为空！");
					$("#desc").focus();
					return;
				} else if(desc.length > 300){
					$("#span2").html("内容长度不能大于300个字！");
					$("#desc").focus();
					return;
				}
				
				
				 */
				$("#myform").submit();
			});
		});
	
	</script>

  </body>
  
</html>
